package com.starlink.client.ras.helper;

import com.starlink.client.ras.properties.RASProperties;
import com.starlink.client.ras.request.LoginRequest;
import com.starlink.client.ras.request.RasBaseRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AccountInfoRequestHelper {
    @Autowired
    private RASProperties RASProperties;

    /**
     * 填充基础账号数据
     * @param request
     */
    public void fillAccountInfo(RasBaseRequest request) {
        request.setPlatformId(RASProperties.getPlatformId());
        request.setPlatformName(RASProperties.getPlatformName());
        request.setProjectId(RASProperties.getProjectId());
        request.setProjectName(RASProperties.getProjectName());
        request.setCompanyId(RASProperties.getCompanyId());
        request.setCompanyName(RASProperties.getCompanyName());
    }

    /**
     * 获取登录入参
     * @return
     */
    public LoginRequest getLoginRequest() {
        LoginRequest loginRequest = new LoginRequest();
        loginRequest.setUsername(RASProperties.getUsername());
        loginRequest.setPassword(RASProperties.getPassword());
        return loginRequest;
    }
}
